package cn.com.nes.site.entity.em;

public enum TradeStateEnum {
    SUCCESS("SUCCESS", "支付成功"),
    REFUND("REFUND", "转入退款"),
    NOTPAY("NOTPAY", "未支付"),
    CLOSED("CLOSED", "已关闭"),
    REVOKED("REVOKED", "已撤销"),
    USERPAYING("USERPAYING", "用户支付中"),
    PAYERROR("PAYERROR", "支付失败"),
    ACCEPT("ACCEPT", "已接收，等待扣款"),
    ;

    TradeStateEnum(String state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    private final String state;
    private final String desc;

    public static TradeStateEnum getEnum(String state) {
        for (TradeStateEnum tradeStateEnum : TradeStateEnum.values()) {
            if (tradeStateEnum.getState().equals(state)) {
                return tradeStateEnum;
            }
        }
        return null;
    }

    public String getState() {
        return state;
    }

    public String getDesc() {
        return desc;
    }
}
